﻿@using Kojarskiy.Core
@using Kojarskiy.Models
@{
    var context = new KojarskiyDbEntities();
}
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>@ViewBag.Title</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />

        <meta name="description" content="@ViewBag.Description" />
        <meta name="keywords" content="@ViewBag.Keywords" />
                
        @*Styles*@
        <link type="text/css" rel="Stylesheet" href="@Url.Content("~/Content/bootstrap.css")" />
        <link type="text/css" rel="Stylesheet" href="@Url.Content("~/Content/bootstrap-theme.css")" />
        <link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/jquery.treeview.css")" />  
        <link type="text/css" rel="Stylesheet" href="@Url.Content("~/Content/jquery.bxslider.css")" />   
        <link type="text/css" rel="stylesheet" href="@Url.Content("~/Content/style.css")" />         
        <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/jquery.gridster.css")" />
        <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/bootstrapValidator.min.css")" />

        @*Scripts*@
       
        @*jQuery*@
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        
        <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.bxslider-config.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.bxslider.min.js")"></script>
        @RenderSection("AdditionalScripts", false)
        @Html.Raw(SettingsManager.GetSettingsItem("DATA_SCRIPTS").Value) 
    </head>
    <body>
        <script>
            (function (d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) return;
                js = d.createElement(s); js.id = id;
                js.src = "//connect.facebook.net/ru_RU/sdk.js#xfbml=1&version=v2.0";
                fjs.parentNode.insertBefore(js, fjs);
            }(document, 'script', 'facebook-jssdk'));
        </script>
          
        @if (User.IsInRole("Administrators"))
        {
            @Html.Partial("_Administration")
        }

        <div id="wrapper">
            <div id="header">
                <div class="header-left">
                    <div id="logo">
                        <a href="@Url.Action("Index", "Home", new { language = Localization.Current })" target="_parent"  class="logo-text-link">
                            <div class="logo-text">@Localization.GetLocalizedValue("LOGO_TEXT")</div>
                            <div class="logo-text-small">@Localization.GetLocalizedValue("LOGO_TEXT_SMALL")</div>
                            <div style="text-align: center;">@Localization.GetLocalizedValue("LOGO_DESCRIPTION")</div>
                        </a>
                    </div>
                </div>
                <div class="header-right">
                    
                    @Html.Raw(SettingsManager.GetSettingsItem("DATA_HEADER").Value) 
               
                    <div class="login">
                        @Html.Partial("_Language")                    
                        @Html.Partial("_LoginPartial")
                    </div>
                </div>
        
                @Html.Partial("_Menu")
   
                <div class="cleaner"></div>

            </div>
        </div> <!-- end of header wrapper -->

        <div id="slider-wrapper">
            @RenderSection("Slider", false)
        </div>
        <div id="content_wrapper_outer">
            <div id="content_wrapper_inner">

                <div id="content_wrapper">        
                    @if (!Kojarskiy.KojarskiyApplication.Message.IsNullOrEmpty())
                    {
                        @Html.Raw(Kojarskiy.KojarskiyApplication.Message.Fomat())
                    }
                    @RenderBody()

                    <div class="cleaner"></div>
                </div>
            </div>
        </div>        

        
        
        <div id="footer_wrapper">
            <div id="footer">
                Copyright © 2014 @Html.Raw(Localization.GetLocalizedValue("COMPANY_NAME")) 

                @Html.Raw(SettingsManager.GetSettingsItem("DATA_FOOTER").Value)

                <div style="float: right; padding-right: 30px;">
                    <a href="#">
                        <div id="fb-root"></div>
                        <div class="fb-share-button" data-href="http://kojarskiy.com.ua/" data-type="button"></div>
                    </a>
                </div>
            </div>
        </div>      

        <a href="#" class="back-to-top"><img src="@Url.Content("~/Content/Images/back-to-top.png")" /></a>
        
        <script type="text/javascript">
            $('#footer_wrapper').css('margin-top', $(document).height() - ($('#wrapper').height() + $('#content_wrapper_outer').height() + $('#slider-wrapper').height()) - $('#footer_wrapper').height());
        </script>        
        
        @*Editor*@
        <script type="text/javascript" src="@Url.Content("~/ckeditor/ckeditor.js")"></script>
        
        @*Bootstrap*@
        <script type="text/javascript" src="@Url.Content("~/Scripts/bootstrap.min.js")"></script>
        
        <script src="@Url.Content("~/Scripts/jquery.treeview.js")" type="text/javascript"></script>

        <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.gridster.with-extras.min.js")"></script>

        <script type="text/javascript" src="@Url.Content("~/Scripts/bootstrapValidator.min.js")"></script>
        <script type="text/javascript" src="@Url.Content("~/Scripts/extentions.js")"></script>
        
        <script type="text/javascript">
            $(document).ready(
                function () {

                    var offset = 220;
                    var duration = 500;

                    $(window).scroll(function () {
                        if (jQuery(this).scrollTop() > offset) {
                            jQuery('.back-to-top').fadeIn(duration);
                        } else {
                            jQuery('.back-to-top').fadeOut(duration);
                        }
                    });

                    $('.back-to-top').click(function (event) {
                        event.preventDefault();
                        jQuery('html, body').animate({ scrollTop: 0 }, duration);
                        return false;
                    });
                }
            );
        </script>         

    </body>
</html>
